package main

import "fmt"
import "unsafe"

// 常量
func constant() {
	fmt.Println()
	fmt.Println("=========constant========")
	fmt.Println()
	const LENGTH int = 10
	const WIDTH int = 20
	var area int
	const a, b, c = 1, false, "str"
	area = LENGTH * WIDTH
	fmt.Println(area)
	println()
	fmt.Println(a, b, c)

	const (
		UNKNOW = 0
		FAMALE = 1
		MALE   = 2
	)
	const (
		e = "abc"
		f = len(e)
		g = unsafe.Sizeof(e)
	)
	fmt.Println(e, f, g)

	const (
		a1 = iota
		a2
		a3
		a4 = "ha"
		a5
		a6 = 100
		a7
		a8 = iota
		a9
	)
	fmt.Println(a1, a2, a3, a4, a5, a6, a7, a8, a9)

	const (
		i = 1 << iota
		j = 3 << iota
		k
		l
	)
	fmt.Println("i=", i)
	fmt.Println("j=", j)
	fmt.Println("k=", k)
	fmt.Println("l=", l)
}
